package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.EventTypeBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IEventTypeView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by XZY on 2017/12/4.
 * 事件类别
 */
public class EventTypePest {

    private IEventTypeView eventTypeView;

    public EventTypePest(IEventTypeView eventTypeView) {
        this.eventTypeView=eventTypeView;
    }


    public void getEventTypeList(){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);

        new ApiManager().getEventTypeList(map, new BaseCallBack<BaseResult<List<EventTypeBean>>>() {
            @Override
            public void onSuccess(BaseResult<List<EventTypeBean>> response) {
                eventTypeView.getEventTypeList(response.getData());
            }
            @Override
            public void onFailures(String message) {
                eventTypeView.showError(message);
            }
        });
    }

}
